package com.special.threademo.concurrency.waitNotify;

/**
 * Created with IDEA2020.3
 * author:LiuYC
 * DateTime:2021/1/7  13:03
 */
public class Client {
    public static void main(String[] args) {
        /**
         * demo1 correct
         */
        DeOrIncrease deOrIncrease = new DeOrIncrease();
        DecreaseThread decreaseThread = new DecreaseThread(deOrIncrease);
        IncreaseThread increaseThread = new IncreaseThread(deOrIncrease);

        /**
         * demo2 incorrect  todo 修改为if (counter = 0)- -> while()
         *
         */

        DecreaseThread decreaseThread2 = new DecreaseThread(deOrIncrease);
        IncreaseThread increaseThread2 = new IncreaseThread(deOrIncrease);
        decreaseThread.start();
        increaseThread.start();
        increaseThread2.start();
        decreaseThread2.start();
    }
}
